Skip to content

Copy job history to avoid InvalidOperationException #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

martincostello
Copy link
Contributor

Copy job history from storage before returning to avoid mutating state.

Surfaced via a failing test in open-telemetry/opentelemetry-dotnet-contrib.

Avoiding for now via open-telemetry/opentelemetry-dotnet-contrib#2835.

Copy job history from storage before returning to avoid mutating state.
@Copilot Copilot AI review requested due to automatic review settings June 11, 2025 09:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request copies the job history before returning it to prevent state mutations and avoid an InvalidOperationException.

  • Clone the job History using ToList() to ensure subsequent modifications do not affect the stored state.
  • Maintain the existing object properties while addressing the failing test.

@perrich perrich merged commit d41fb18 into perrich:master Jun 14, 2025
1 check passed
@perrich
Copy link
Owner

perrich commented Jun 14, 2025

Thank you for the fix.

@martincostello martincostello deleted the copy-job-history branch June 14, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants